Arnold-Beltrami-Childress flow

Example for the deeptime.data.abc_flow() dataset.

 8 import numpy as np
 9 from matplotlib import animation
10
11 import matplotlib.pyplot as plt
12 from mpl_toolkits.mplot3d import Axes3D
13
14 from deeptime.data import abc_flow
15
16
17 def update(num):
18     data = scatters[num]
19     graph.set_data(data[:, 0], data[:, 1])
20     graph.set_3d_properties(data[:, 2])
21     return graph,
22
23
24 system = abc_flow(n_steps=25)
25 scatters = [np.random.uniform(np.pi-.5, np.pi+.5, size=(500, 3))]
26 for _ in range(50):
27     scatters.append(system(scatters[-1], n_jobs=8))
28
29 scatters = np.array(scatters)
30
31 f = plt.figure(figsize=(18, 18))
32
33 ax = f.add_subplot(1, 1, 1, projection='3d')
34 ax.set_title('Evolution of test points in the ABC flowfield')
35 graph, = ax.plot(*scatters[0].T, linestyle="", marker="o")
36 ax.set_xlim([0, 2*np.pi])
37 ax.set_ylim([0, 2*np.pi])
38 ax.set_zlim([0, 2*np.pi])
39
40 ani = animation.FuncAnimation(f, update, 50, interval=50, blit=True)

Total running time of the script: ( 0 minutes 14.000 seconds)

Estimated memory usage: 21 MB

Gallery generated by Sphinx-Gallery